<?php

class UserController extends CController{

    public $layout = 'main1';

    public $breadcrumbs = array();

    public $menu = array();

    public function __construct($id, $module = null) {

        parent::__construct($id, $module);

        //check user login

        if(Yii::app()->user->isGuest){

            //redirect to login page

            $this->redirect(array('site/login'));

        }

        //register js, css
        $app=  app();
        $app->getClientScript()->registerCoreScript( 'jquery' );
        $app->getClientScript()->registerCssFile(www().'css/style.css');
        $app->getClientScript()->registerScriptFile(www().'js/script.js', CClientScript::POS_END);
    }

}